//package com.wangyadong.hobby.nio;
//
//import com.wangyadong.hobby.nio.charter2.EchoServerHandler;
//import io.netty.bootstrap.ServerBootstrap;
//import io.netty.channel.ChannelFuture;
//import io.netty.channel.ChannelInitializer;
//import io.netty.channel.nio.NioEventLoopGroup;
//import io.netty.channel.socket.SocketChannel;
//import io.netty.channel.socket.nio.NioServerSocketChannel;
//
//import javax.annotation.concurrent.Immutable;
//import javax.annotation.concurrent.ThreadSafe;
//import java.net.InetSocketAddress;
//@Immutable
//@ThreadSafe
//public class AA {
//
//    public static void main(String[] args) throws InterruptedException {
//        NioEventLoopGroup group = new NioEventLoopGroup();
//        ServerBootstrap b = new ServerBootstrap();
//        b.group(group)
//                .channel(NioServerSocketChannel.class)
//                .localAddress(new InetSocketAddress(56))
//                .childHandler(new ChannelInitializer<SocketChannel>(
//                ) {
//                    @Override
//                    protected void initChannel(SocketChannel socketChannel) throws Exception {
//                        socketChannel.pipeline().addLast(new EchoServerHandler());
//                    }
//                });
//
//        ChannelFuture future = b.bind().sync();
//        future.channel().closeFuture();
//
//
//    }
//}
